@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using JS.Abp.RulesEngine.Permissions
@using JS.Abp.RulesEngine.Web.Pages.RulesEngine.RulesGroups
@using JS.Abp.RulesEngine.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using JS.Abp.RulesEngine.Localization
@inject IHtmlLocalizer<RulesEngineResource> L
@inject IAuthorizationService Authorization
@model IndexModel
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["RulesGroups"].Value;
    PageLayout.Content.MenuItemName = RulesEngineMenus.RulesGroups;
}

@section styles
{

}

@section scripts
{
    <abp-script src="/Pages/RulesEngine/RulesGroups/index.js" />

}

@section content_toolbar {
    <abp-button id="ExportToExcelButton" text="@L["ExportToExcel"].Value" icon="download" size="Small" button-type="Primary" />
    @if (await Authorization.IsGrantedAsync(RulesEnginePermissions.RulesGroups.Create))
    {
        <abp-button id="NewRulesGroupButton" text="@L["NewRulesGroup"].Value" icon="plus" size="Small" button-type="Primary" />
    }

}



<abp-card>
    <abp-card-body>
		<abp-row class="mb-3">
            <abp-column size-md="_12">
                <form id="SearchForm" autocomplete="off">
                    <div class="input-group">
                        <input class="form-control page-search-filter-text" id="FilterText" placeholder="@L["Search"]"/>
                        <abp-button button-type="Primary" type="submit" icon="search"/>
                    </div>
                </form>
            </abp-column>
            <abp-column size-md="_12" class="mt-3">
                <a href="javascript:;" id="AdvancedFilterSectionToggler" class="text-decoration-none">@L["SeeAdvancedFilters"]</a>
            </abp-column>
        </abp-row>

        <abp-row id="AdvancedFilterSection" style="display: none;">
            <abp-column size="_3">
                <abp-input asp-for="GroupNameFilter" label="@L["GroupName"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-select asp-for="OperatorTypeFilter" label="@L["OperatorType"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DescriptionFilter" label="@L["Description"].Value" />
            </abp-column>

        </abp-row>

        <abp-table striped-rows="true" id="RulesGroupsTable">
            <thead>
				<tr>
					<th>@L["Actions"]</th>
					<th>@L["GroupName"]</th>
					<th>@L["OperatorType"]</th>
					<th>@L["Description"]</th>


				</tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>

